package com.hyacinth.future;

/**
 * 真实数据
 * @author zhangfb
 * @version 1.0.0.1
 * @since JDK 1.8
 */
public class RealData implements Data {

    private final String result;

    public RealData(String param) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < 10; i++) {
            sb.append(param);
            try {
                // 模拟一个耗时操作，数据库操作，网络请求。。。
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        this.result = sb.toString();
    }

    @Override
    public String getResult() {
        return result;
    }
}
